import request from '../utils/request.js'

// 获取后台数据
export function fetchOwnerInfo(query) {
    return request({
        url: '/account/users/list/',
        method: 'get',
        params: query
    })
}

// 添加的接口
export function createOwnerInfo(data) {
    return request({
        url: `/account/users/`,
        method: 'post',
        data
    })
}

// 编辑的接口
export function updateOwnerInfo(data, id) {
    return request({
        url: `/account/users/${id}/`,
        method: 'patch',
        data
    })
}

// 删除的接口
export function deleteOwnerInfo(id) {
    return request({
        url: `/account/users/${id}/`,
        method: 'delete'
    })
}

// 修改密码的接口
export function modifyPass(data) {
    return request({
        url: `/account/changepwd/`,
        method: 'post',
        data
    })
}

// 获取人员微信信息
export function fetchWxInfo(query) {
    return request({
        url: '/account/wxusers/list/',
        method: 'get',
        params: query
    })
}

// 解除微信绑定
export function removeWxBound(id, data) {
    return request({
        url: `/account/wxusers/${id}/`,
        method: 'patch',
        data
    })
}

// 获取二维码信息
export function fetchWxQrCodeInfo(query) {
    return request({
        url: '/weixin/qrcode/',
        method: 'get',
        params: query
    })
}

// 重置密码
export function resetPasswords(data) {
    return request({
        url: '/account/resetpwd/',
        method: 'post',
        data
    })
}